package spark.graphics;

import spark.math.Vector3;
import spark.math.Vector2;

public class SpriteRenderable implements ISpriteRenderable {
	private Sprite sprite;
	private Vector3 position = new Vector3();
	private Vector2 dimensions;

	public Vector3 getPosition() {
		return position;
	}

	@Override
	public Vector2 getDimensions() {
		return dimensions == null ? (sprite == null ? null : sprite.getDimensions()) : dimensions;
	}

	@Override
	public Sprite getSprite() {
		return sprite;
	}

	public void setSprite(Sprite sprite) {
		this.sprite = sprite;
	}

	public void setPosition(Vector3 position) {
		this.position = position;
	}

	public void setDimensions(Vector2 dimensions) {
		this.dimensions = dimensions;
	}

	@Override
	public boolean isRenderReady() {
		return sprite != null;
	}
}
